package com.protocols.sctp.m3ua.sccp.tcap.map;

import java.io.Serializable;

import com.protocols.BCDNumber;
import com.protocols.OctaveInteger;
import com.protocols.ProtoOperations;
import com.protocols.ProtocolStackException;
import com.protocols.sctp.m3ua.sccp.tcap.TcapBegin;
import com.protocols.sctp.m3ua.sccp.tcap.TcapConstructor;
import com.protocols.sctp.m3ua.sccp.tcap.TcapPrimitive7BitEncodedString;
import com.protocols.sctp.m3ua.sccp.tcap.TcapPrimitiveUnitByteArray;
import com.protocols.sctp.m3ua.sccp.tcap.TcapPrimitiveUnitNumber;
import com.protocols.sctp.m3ua.sccp.tcap.TcapPrimitiveUnitString;

public class MapInvokeUnstructuredSSRequest extends MapInvoke implements Serializable{
	
	private TcapConstructor Parameters = new TcapConstructor(0x30);
	private TcapPrimitiveUnitNumber DataCodingScheme= new TcapPrimitiveUnitNumber(0x04);
	private TcapPrimitive7BitEncodedString USSDString= new TcapPrimitive7BitEncodedString(0x04);
	private TcapPrimitiveUnitNumber AlertingPattern= new TcapPrimitiveUnitNumber(0x04);
	
	
	public MapInvokeUnstructuredSSRequest() {
		super();	
		super.Invoke.addElement(Parameters);
		Parameters.addElement(DataCodingScheme);
		Parameters.addElement(USSDString);
		Parameters.addElement(AlertingPattern);
		
		
		setOpCode(60,true);	//  USSD Request
	}
	

	
	public TcapConstructor getRootComponent(){
		return Invoke;
	}



	public long getDataCodingScheme() {
		return DataCodingScheme.getTagValue();
	}

	public int getDataCodingIndicator() {
		return ((int)DataCodingScheme.getTagValue()>>4);
	}
	
	public long getDataCodingInfo() {
		return ((int)DataCodingScheme.getTagValue()&0x0f);
	}


	public void setDataCodingScheme(int codingIndicator, int CodingInfo) {
		DataCodingScheme.setTagValue((codingIndicator<<4)|CodingInfo);
	}

	public void setDataCodingScheme(long dataCodingScheme) {
		DataCodingScheme.setTagValue(dataCodingScheme);
	}

	public String getUSSDString() {
		return USSDString.getTagValue();
	}



	public void setUSSDString(String uSSDString) {
		USSDString.setTagValue( uSSDString);
	}


	public long getAlertingPattern() {
		return AlertingPattern.getTagValue();
	}


	public void setAlertingPattern(long alertingPattern) {
		AlertingPattern.setTagValue( alertingPattern);
	}
	
	
	
}
